# Contributor: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
# Maintainer: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
pkgname=gr-osmosdr
pkgver=0.2.3
pkgrel=10
pkgdesc="osmocom Gnu Radio Blocks"
url="https://osmocom.org/projects/gr-osmosdr/wiki"
arch="x86_64 aarch64" # limited by libvolk and gnuradio
license="GPL-3.0-only"
subpackages="$pkgname-doc $pkgname-dev"
depends_dev="
	bladerf-dev
	gnuradio-dev
	hackrf-dev
	librtlsdr-dev
	"
makedepends="
	$depends_dev
	cmake
	doxygen
	graphviz
	libvolk-dev
	samurai
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/osmocom/gr-osmosdr/archive/v$pkgver.tar.gz
	use-std-shared-ptr.patch
	gnuradio-3.9-compat.patch
	fix-docstrings.patch
	add-python-bindings.patch
	"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-Wno-dev
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

check() {
	cmake --build build --target test
}

sha512sums="
3c82a39972a309aa5b023b9c5e61f1fc80b797380b7a6c6c23cd4fe278cfaba3ab3019f32d38ebc01300868bb892f6aaaa7f12c9ee9b7ab5ba3e38817a40bf3e  gr-osmosdr-0.2.3.tar.gz
c0c06b9f5907db565ddea1c6ee5ebfaaa8e6bf66950581467d8173deb8cbecadc57ff32b3683eb3affd0368b11e399ded58824490cecddbe38b5b174d69b0630  use-std-shared-ptr.patch
617edcdc27d7a9799caef1a1e778222d7954288cb767f76f81e68def2f66b4ba7640ff08866d696109a0d6bd0473bf996c3707bedadc59e283261d42c209bfbb  gnuradio-3.9-compat.patch
d66309f99144515aeae771a6bf4f64defa35f7a9f9c4c646e807c6d6df5d817346de0a66cb9114716b32990d9837ea9107efb3b2fc0fd32de7453ec235e1f667  fix-docstrings.patch
94730f15580c8dd46803da78fe36b7c8afefc735330918c4f58beaabb0a12b5898041dfe70167d55a55e682c8536ef441d2b9ea4e3c069a637e3fbb1950716aa  add-python-bindings.patch
"
